<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="/WEB-INF/tld/Paging.tld" prefix="pagingTag"%>
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags"%>
<head>
	<title>Chỉnh sửa chapter ${chapter.name}</title>
	<script type="text/javascript">
		$(function(){
			//lay thong bao notice
		  	var notice = $.getUrlVar('notice');
			if (notice != null || notice != "") {
				if(notice=="successfully"){
					$("#notice").html("Thành công");
					$("#notice").fadeOut(5000);
				}else if(notice=="error"){
					$("#notice").html("Dữ liệu truyền vào chưa chính xác.");
					$("#notice").fadeOut(5000);
				}
			}
			//end
		});
	</script>
</head>
<body>
	<section class="form">
		<form action="<spring:url value="/quan-ly/chapterTruyenTinhCam/xu-ly-cap-nhat-chapter.htm" />" method="post">
			<fieldset>
				<legend>Chỉnh sửa chapter ${chapter.name}</legend>
				<section>
					<label for="name">Tên chapter truyện: </label>
					<input type="text" id="name" name="name" class="validate[required]" placeholder="Nhập tên chapter truyện..." value="${chapter.name}" />
				</section>
				<section>
					<label for="chapterNumber">Chapter number : </label>
					<input type="text" id="chapterNumber" name="chapterNumber" value="${chapter.chapterNumber}" />
				</section>
				<section>
					<label for="content">Content : </label>
					<textarea id="content" name="content" cols="100" rows="20">${chapter.content}</textarea>
				</section>
				<section>
					<label>IsDelete: </label>
					Xóa<input type="radio" name="isDelete" value="true" <c:if test="${chapter.isDelete}">checked="checked"</c:if> />
					Bỏ Xóa<input type="radio" name="isDelete" value="false" <c:if test="${chapter.isDelete==false}">checked="checked"</c:if> />
				</section>
				<section>
					<label>IsHot: </label>
					Hot<input type="radio" name="isHot" value="true" <c:if test="${chapter.isHot}">checked="checked"</c:if> />
					Bỏ hot<input type="radio" name="isHot" value="false" <c:if test="${chapter.isHot==false}">checked="checked"</c:if> />
				</section>
				<section>
					<input type="hidden" name="id" value="${chapter.id}" />
					<c:if test="${idTruyen != null}"><input type="hidden" name="idTruyen" value="${idTruyen}" /></c:if>
					<button type="submit" class="button medium blue">Cập nhật</button>
				</section>
			</fieldset>
		</form>
	</section>
	<section class="clr"></section>
</body>
